package com.lumberer.pay2021.util;

import java.util.ArrayList;

/**
 * 返回类
 * @author lumberer
 */
public class Result {
	private int statu;
	private String msg;
	private Object data;
	
	
	public int getStatu() {
		return statu;
	}
	public void setStatu(int statu) {
		this.statu = statu;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
	
	public static Result success(int statu,String msg,Object data){
		Result result=new Result();
		result.setStatu(statu);
		result.setMsg(msg);
		if(null==data){
			data=new ArrayList<>();
		}
		result.setData(data);
		return result;
	}
	public static Result error(int statu,String msg,Object data){
		Result result=new Result();
		result.setStatu(statu);;
		result.setMsg(msg);
		if(null==data){
			data=new ArrayList<>();
		}
		result.setData(data);
		return result;
	}
}
